package com.netease.pris.activity;

import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.netease.framework.ActivityEx;
import com.netease.framework.k;
import com.netease.l.a.a;
import com.netease.pris.a.h;
import com.netease.pris.activity.view.PRISActivityTitleTextView;
import com.netease.pris.activity.view.PRISActivityUserIcon;
import com.netease.pris.atom.userinfo.UserInfo;
import com.netease.pris.b;
import com.netease.pris.v;

public class PRISActivityUserInfo extends ActivityEx
{
  static final int a = 1;
  private static final String c = "PRISActivityUserInfo";
  private static final String l = "mode";
  private static final int m = 1;
  private static final int n = 2;
  private static final int o = 1;
  private static final int p = 2;
  b b = new dv(this);
  private PRISActivityUserIcon d;
  private PRISActivityTitleTextView e;
  private PRISActivityTitleTextView f;
  private String g;
  private UserInfo h;
  private Bitmap i;
  private View j;
  private View k;
  private int q = 1;

  private void a(int paramInt, Intent paramIntent)
  {
    if (paramInt == -1)
      if (paramIntent != null)
      {
        this.i = ((Bitmap)paramIntent.getParcelableExtra("data"));
        UserInfo localUserInfo = (UserInfo)paramIntent.getParcelableExtra("extra_userinfo_value");
        g();
        a(localUserInfo);
      }
    while (true)
    {
      return;
      v.a().e(this.g);
      continue;
      if (paramInt != 0)
        continue;
    }
  }

  public static void a(Context paramContext, String paramString)
  {
    if (TextUtils.isEmpty(paramString))
      h.a(paramContext, 2131362106);
    while (true)
    {
      return;
      Intent localIntent = new Intent(paramContext, PRISActivityUserInfo.class);
      localIntent.putExtra("extra_userinfo_name", paramString);
      localIntent.putExtra("mode", 1);
      paramContext.startActivity(localIntent);
    }
  }

  private void a(UserInfo paramUserInfo)
  {
    if (paramUserInfo == null);
    while (true)
    {
      return;
      this.h = paramUserInfo;
      String str1 = paramUserInfo.x();
      String str2;
      if (!TextUtils.isEmpty(str1))
      {
        this.d.a(str1);
        if (paramUserInfo.d())
          this.d.b(a.b(this, paramUserInfo.g()));
        if (paramUserInfo.e())
        {
          str2 = paramUserInfo.w();
          if (this.i == null)
            break label233;
          this.d.a(this.i);
        }
      }
      while (true)
      {
        StringBuilder localStringBuilder = new StringBuilder();
        com.netease.image.d.a().a(localStringBuilder, 1, str2, new dy(this, localStringBuilder), 48, 48, 1);
        if (!paramUserInfo.c())
          break label252;
        String[] arrayOfString = paramUserInfo.v();
        LinearLayout.LayoutParams localLayoutParams2 = new LinearLayout.LayoutParams(-1, -2);
        if (arrayOfString == null)
          break label252;
        for (int i1 = 0; i1 < arrayOfString.length; i1++)
        {
          TextView localTextView2 = (TextView)getLayoutInflater().inflate(2130903075, null);
          localTextView2.setText(arrayOfString[i1]);
          localTextView2.setTextColor(Color.rgb(102, 102, 102));
          localTextView2.setLayoutParams(localLayoutParams2);
          this.f.a(localTextView2);
        }
        this.d.a("");
        break;
        label233: this.d.setId(k.a(this).a(2130837804));
      }
      label252: if (!paramUserInfo.b())
        continue;
      LinearLayout.LayoutParams localLayoutParams1 = new LinearLayout.LayoutParams(-1, -2);
      TextView localTextView1 = (TextView)getLayoutInflater().inflate(2130903075, null);
      localTextView1.setText(paramUserInfo.f());
      localTextView1.setLayoutParams(localLayoutParams1);
      localTextView1.setTextColor(Color.rgb(102, 102, 102));
      this.e.a(localTextView1);
    }
  }

  private void a(String paramString)
  {
    if (TextUtils.isEmpty(paramString))
      h.a(this, 2131362103);
    while (true)
    {
      return;
      v.a().e(paramString);
    }
  }

  private void b()
  {
    setTitle(2131362102);
    if (this.q == 2)
      g(8);
    while (true)
    {
      this.g = getIntent().getStringExtra("extra_userinfo_name");
      a(this.g);
      this.j = findViewById(2131558680);
      this.k = findViewById(2131558682);
      this.j.setBackgroundDrawable(k.a(this).b(2130837721));
      this.k.setBackgroundDrawable(k.a(this).b(2130837721));
      this.d = ((PRISActivityUserIcon)findViewById(2131558679));
      this.e = ((PRISActivityTitleTextView)findViewById(2131558681));
      this.e.a(2131362035);
      this.f = ((PRISActivityTitleTextView)findViewById(2131558683));
      this.f.a(2131362036);
      return;
      f(2130837814);
      findViewById(2131558408).setOnClickListener(new dw(this));
    }
  }

  public static void b(Context paramContext, String paramString)
  {
    if (TextUtils.isEmpty(paramString))
      h.a(paramContext, 2131362106);
    while (true)
    {
      return;
      Intent localIntent = new Intent(paramContext, PRISActivityUserInfo.class);
      localIntent.putExtra("extra_userinfo_name", paramString);
      localIntent.putExtra("mode", 2);
      paramContext.startActivity(localIntent);
    }
  }

  private void c()
  {
    com.netease.b.a.d.h().k();
    PRISActivitySetting.b(this);
    finish();
  }

  private void e()
  {
    PRISActivityUserInfoModify.a(this, 1, this.h, this.i);
  }

  private void f()
  {
    showDialog(1);
  }

  private void g()
  {
    this.e.a();
    this.f.a();
  }

  protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
  {
    switch (paramInt1)
    {
    default:
    case 1:
    }
    while (true)
    {
      super.onActivityResult(paramInt1, paramInt2, paramIntent);
      return;
      a(paramInt2, paramIntent);
    }
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903116);
    v.a().a(this.b);
    if (getIntent() != null)
      this.q = getIntent().getIntExtra("mode", 1);
    b();
  }

  protected Dialog onCreateDialog(int paramInt)
  {
    switch (paramInt)
    {
    default:
    case 1:
    }
    AlertDialog.Builder localBuilder;
    Object[] arrayOfObject;
    for (Object localObject = super.onCreateDialog(paramInt); ; localObject = localBuilder.setMessage(getString(2131362051, arrayOfObject)).setPositiveButton(2131362052, new du(this)).setNegativeButton(2131362053, new dx(this)).create())
    {
      return localObject;
      localBuilder = new AlertDialog.Builder(this).setIcon(2130837639).setTitle(2131362050);
      arrayOfObject = new Object[1];
      arrayOfObject[0] = com.netease.b.a.d.h().c();
    }
  }

  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    if (this.q == 2);
    for (boolean bool = super.onCreateOptionsMenu(paramMenu); ; bool = super.onCreateOptionsMenu(paramMenu))
    {
      return bool;
      paramMenu.add(0, 1, 0, 2131362104).setIcon(2130837652);
      paramMenu.add(0, 2, 0, 2131362105).setIcon(2130837658);
    }
  }

  protected void onDestroy()
  {
    if (this.i != null)
    {
      this.i.recycle();
      this.i = null;
    }
    v.a().b(this.b);
    super.onDestroy();
  }

  public boolean onOptionsItemSelected(MenuItem paramMenuItem)
  {
    boolean bool = true;
    switch (paramMenuItem.getItemId())
    {
    default:
      bool = onOptionsItemSelected(paramMenuItem);
    case 1:
    case 2:
    }
    while (true)
    {
      return bool;
      e();
      continue;
      f();
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.PRISActivityUserInfo
 * JD-Core Version:    0.6.0
 */